import request from "../utils"

export let add_address = (userid:any,name:any,tel:any,province:any,city:any,county:any,addressDetail:any,isDefault:any)=>{
    return request({
        url:"/api/address/add",
        method:"POST",
        data:{
            userid,name,tel,province,city,county,addressDetail,isDefault
        }
    })
}

export let address_list = (userid:any)=>{
    return request({
        url:"/api/address/list",
        method:"GET",
        params:{
            userid
        }
    })
}

export let updata = (paylod={})=>{
    return request({
        url:"/api/address/update",
        method:"POST",
        data:paylod
    })
}

export let del = (addressid:string)=>{
    return request({
        url:"/api/address/delete",
        method:"POST",
        data:{
            // token:localStorage.getItem('token'),
            addressid
        }
    })
}

export let defaultAddress = (userid:any)=>{
    return request({
        url:"/api/address/defaultAddress",
        method:"POST",
        params:{
            userid
        }
    })
}